#include "lvgl.h"

/*******************************************************************************
 * Tool: MCU_Font V2.0
 * Time: 2020-11-12 23:52:43
 * Bpp: 4
 * LineHeight: 16 px
 * BaseLine: 4
 * 
 * FontCount: 1
 * FontSize_1: 6px  FontFamily_1: 微软雅黑  
 ******************************************************************************/

#ifndef DATE_TIME_FONT_6
#define DATE_TIME_FONT_6 1
#endif

#if DATE_TIME_FONT_6

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = {

    /* U+2d "-" */
    0xff, 

    /* U+30 "0" */
    0x5, 0xff, 0x73, 0xd1, 0x1d, 0x57, 0x0, 0xa7, 
    0x50, 0x7, 0x75, 0x0, 0x77, 0x70, 0xa, 0x3d, 
    0x11, 0xc0, 0x7f, 0xf5, 

    /* U+31 "1" */
    0x7, 0xce, 0xbb, 0x3, 0xb0, 0x3b, 0x3, 0xb0, 
    0x3b, 0x3, 0xb0, 0x3b, 

    /* U+32 "2" */
    0xaf, 0xf7, 0x40, 0x1d, 0x0, 0x9, 0x0, 0x3b, 
    0x5, 0xe1, 0xaa, 0x0, 0xa0, 0x0, 0xff, 0xff, 

    /* U+33 "3" */
    0x5f, 0xf5, 0x80, 0x3b, 0x0, 0x39, 0x7f, 0xc0, 
    0x0, 0x3d, 0x0, 0xb, 0x50, 0x3d, 0xcf, 0xf3, 

    /* U+34 "4" */
    0x0, 0xa, 0xa0, 0x0, 0x3f, 0xa0, 0x1, 0xc7, 
    0xa0, 0xa, 0x55, 0xa0, 0x77, 0x5, 0xa0, 0xef, 
    0xff, 0xfc, 0x0, 0x5, 0xa0, 0x0, 0x5, 0xa0, 

    /* U+35 "5" */
    0xcf, 0xfc, 0xa1, 0x0, 0xc1, 0x0, 0xef, 0xf5, 
    0x0, 0x3e, 0x0, 0x9, 0x0, 0x3d, 0xef, 0xf3, 

    /* U+36 "6" */
    0xc, 0xff, 0x3a, 0x70, 0x0, 0xb0, 0x0, 0x9, 
    0xef, 0xc0, 0xe1, 0xa, 0x77, 0x0, 0x57, 0xc1, 
    0xa, 0x55, 0xff, 0xa0, 

    /* U+37 "7" */
    0xff, 0xff, 0x0, 0xa, 0x0, 0x77, 0x1, 0xc1, 
    0x7, 0x70, 0x1c, 0x10, 0x5a, 0x0, 0x77, 0x0, 

    /* U+38 "8" */
    0x7, 0xff, 0x73, 0xb0, 0xb, 0x3d, 0x10, 0xb0, 
    0x5f, 0xf7, 0x3b, 0x0, 0xb7, 0x70, 0x5, 0x5c, 
    0x0, 0xc0, 0xaf, 0xfa, 

    /* U+39 "9" */
    0x7, 0xff, 0x55, 0xc0, 0x1c, 0x77, 0x0, 0x75, 
    0xc0, 0xc, 0xa, 0xff, 0xb0, 0x0, 0x9, 0x0, 
    0x5, 0xc1, 0xef, 0xe1, 

    /* U+3a ":" */
    0xa0, 0x0, 0x14, 

    /* U+5f "_" */
    0xef, 0xff, 
};

/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
/* id = 0 reserved */  {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
/* U+2d "-" */  {.bitmap_index = 0, .adv_w = 56, .box_w = 2, .box_h = 1, .ofs_x = 1, .ofs_y = 2},
/* U+30 "0" */  {.bitmap_index = 1, .adv_w = 88, .box_w = 5, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
/* U+31 "1" */  {.bitmap_index = 21, .adv_w = 88, .box_w = 3, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
/* U+32 "2" */  {.bitmap_index = 33, .adv_w = 88, .box_w = 4, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
/* U+33 "3" */  {.bitmap_index = 49, .adv_w = 88, .box_w = 4, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
/* U+34 "4" */  {.bitmap_index = 65, .adv_w = 88, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
/* U+35 "5" */  {.bitmap_index = 89, .adv_w = 88, .box_w = 4, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
/* U+36 "6" */  {.bitmap_index = 105, .adv_w = 88, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
/* U+37 "7" */  {.bitmap_index = 125, .adv_w = 88, .box_w = 4, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
/* U+38 "8" */  {.bitmap_index = 141, .adv_w = 88, .box_w = 5, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
/* U+39 "9" */  {.bitmap_index = 161, .adv_w = 88, .box_w = 5, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
/* U+3a ":" */  {.bitmap_index = 181, .adv_w = 24, .box_w = 1, .box_h = 5, .ofs_x = 1, .ofs_y = 0},
/* U+5f "_" */  {.bitmap_index = 184, .adv_w = 56, .box_w = 4, .box_h = 1, .ofs_x = 0, .ofs_y = -3},
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_1[] = {

    0x2d, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 
    0x37, 0x38, 0x39, 0x3a, 0x5f, 
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 0, .range_length = 95, .glyph_id_start = 1,
        .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 13, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};

/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/
/*Store all the custom data of the font*/
static lv_font_fmt_txt_dsc_t font_dsc = {
    .glyph_bitmap = gylph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 1,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0
};

/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
lv_font_t date_time_font_6 = {
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 16,          /*The maximum line height required by the font*/
    .base_line = 4,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
#endif /*#if DATE_TIME_FONT_6*/
